#ifndef Keyboard_h
#define Keyboard_h
#include <Windows.h>
#include "GenericDevice.h"

// Buffer size
const static unsigned kuiInputBufferSize = 128;
// Chanel size
const static unsigned kuiInputChanelSize = 256;

class cKeyboard : public cGenericDevice {
private:
	HANDLE mStdin;
	DWORD mOldModeSaved;
	bool mabInputBuffer[kuiInputChanelSize];
	bool mbIsValid;

	void KeyEventProc(KEY_EVENT_RECORD lKey);
public:
	// Constructor
	inline cKeyboard() {mbIsValid = false;}
	// Initialize the device
	void Init();
	// Deinitialize the device
	void DeInit();
	// Update the device's state
	void Update();
	// Check the chanel "luiEntry" state's  in the device
	float Check(unsigned luiEntry);
	// It is valid the device
	inline bool IsValid() {return mbIsValid;}
};
#endif